package {
	
	/**
	 * ...
	 * @author hungconcon
	 */
	public class NawClass {
		
		public function testData():void {
				App.px = p.x;
				App.py = p.y;
				xs = App.pspeed;
				App.act = "stand";
				pymin = 10;
				pymax = 200;
				powermax = 31;
				powermin = 15;
				powerrange = powermax - powermin;
				
				onMouseDown = function ()
				{
					if (App.hold && !stat.speaker.hitTest(App._xmouse, App._ymouse, 1)) 
					{
						powerdiv = (pymax - Math.max(pymin, Math.min(pymax, App._ymouse))) / (pymax - pymin);
						delete onEnterFrame;
						delete onMouseDown;
						gotoAndPlay("shoot");
					}
				}
				;
				onEnterFrame = function ()
				{
					App.oldx = App.px;
					App.px = Math.max(App.xmin, Math.min(App._xmouse, App.xmax));
					App.py = Math.max(App.ymin, Math.min(App._ymouse, App.ymax));
					
					dx = App.px - p.x;
					
					(Math.abs(dx) > 1) ? ((dx > 0)? (App.hd = 1) : (App.hd = 2)) : null;
					
					if (Math.abs(dx) > Math.abs(xs)) 
					{
						++runtime;
						moving = 500;
						dx > 0 ? (nx = p.x + xs) : (nx = p.x - xs);
						p.x = nx;
					}
					else 
					{
						if (runtime > 3) 
						{
							p.x = App.px;
							moving = runtime = 0;
						}
						else if (Math.abs(dx) > 3) 
						{
							p.x = App.px;
							moving = 500;
						}
						moving > 495 ? (moving = 5) : (moving > 5 ? (moving = 0) : null);
					}
					moving > 0 ? moving-- : null;
					App.act = "run";
					if (Math.abs(App.oldx - App.px) < 1) 
					{
						!moving || p.x == App.xmax || p.x == App.xmin ? (App.act = "stand") : null;
					}
					p.gotoAndStop(App.act + App.hold);
					App.hd == 1 ? (p._xscale = 100) : (p._xscale = -100);
					if (App.hold) 
					{
						return undefined;
					}
					closeball = undefined;
					balldist = 1000;
					var __reg1 = 0;
					while (__reg1 < App.balls.length) {
						if (App.balls[__reg1]._y > 270) 
						{
							dx = Math.abs(App.balls[__reg1]._x - p.x);
							if (dx < 40 && dx < balldist){
								balldist = dx;
								closeball = App.balls[__reg1];
							}
						}
						++__reg1;
					}
					if (balldist < 1000){
						App.hold = 1;
						App.ballcolor = closeball.bcolor;
						App.balls.removeValue(closeball);
						closeball.removeMovieClip();
						App.zgrab.start();
					}
				}
				stop();
		}
		
		
		
		call("pro");
		fadescreen(8);
		_global.m = this.map;
		_global.m2 = this.map2;
		_global.stat = this.stat;
		_global.p = m.attachMovie("ben", "ben", 80010, {dep: 80010, _x: 200, _y: 400});
		_global.cursor = m.attachMovie("cursor", "cursor", 93000, {dep: 80011, _xpos: 200, _ypos: 400});
		Mouse.hide();
		
		ringscore = [0, 100, 150, 200, 250];
		multiringscore = [0, 0, 1000, 3000];
		onesec = 28;
		td = trafficdelay = 200;
		linepos = [null, 75, 138, 200];
		linedir = [null, 1, -1, 1];
		linespeednormal = 1.5;
		linespeedrandom = 20;
		linespeed = [null, linespeednormal, linespeednormal + 1, linespeednormal + 0.5];
		linefree = [null, 1, 2, 3];
		lineid = [1, 2, 3];
		triplebonus = 0;
		bonustipe = [11, 12, 13, 14, 15, 16];
		slowtime = 400;
		bigtime = 400;
		bonustime = 20 * onesec;
		bonusnil = 3000;
		triplebonustime = 400;
		removeballdelay = 50;
		removeball = 0;
		waktu = waktumax = 120 * onesec;
		gotwaktu = 30;
		pspeed = 15;
		bde = 100;
		yland = 400;
		ballcolor = 1;
		screenwid = 600;
		screenhei = 400;
		ringxmin = -40;
		ringxmax = screenwid + 40;
		xmin = 50;
		xmax = screenwid - 50;
		grav = 2;
		dd = bonusdelay = 6;
		dotspace = dotspacenormal = 23;
		dotspacebig = 34;
		diff = diffdelay = 800;
		ang = timeup = freeze = got = big = slow = multiball = triplebonus = hold = 0;
		resetrandom();
		ringd = ringdelay = 10;
		rings = [];
		dots = [];
		balls = [];
		b = 40100;
		bd = 20000;
		bsd = 1000;
		rd = 35000;
		popd = 90000;
		
		App.attachMovie("info", "info", 31000, {_x: 354, _y: 200});
		if (!App.udamusik) {
			App.udamusik = 1;
			stopAllSounds();
			App.createEmptyMovieClip("sfx", 60001);
			allsfx = ["zgrab", "zstep1", "zstep2", "ztititink", "ztitink", "ztink", "ztic", "zbonus", "zgot"];var i = 0;
			while (i < allsfx.length) {
				App[allsfx[i]] = new Sound(sfx);
				App[allsfx[i]].attachSound(allsfx[i]);
				++i;
			}
			App.createEmptyMovieClip("sfx3", 60003);
			App.zring = new Sound(sfx3);
			App.zring.attachSound("zring");
			App.createEmptyMovieClip("sfx4", 60004);
			App.zswish = new Sound(sfx4);
			App.zswish.attachSound("zswish");
			App.createEmptyMovieClip("sfx2", 60002);
			App.zloop = new Sound(sfx2);
			App.zloop.attachSound("zloop");
			App.zloop.start(0, 99999);
		}
		makering(1 + random(4), 0, linepos[1]);
		makering(1 + random(4), screenwid, linepos[2]);
		makering(1 + random(4), 0, linepos[3]);
		makeball(1, 200, App.yland, 0, -1);
		stat.timer.play();
		onEnterFrame = function() {
			App.freeze ? null : moverings();
			cekballdotcoll();
			cekballcoll();
			if (App.slow) {
				App.slow.isMultipleOf(3) ? ringd-- : null;
			} else {
				--ringd;
			}
			if (ringd < 0 || (App.rings.length < 8 && App.rings.length < 12)) {
				ringd = ringdelay;
				var __reg3 = [];
				__reg3 = App.linefree.copy();
				__reg3.randomize();
				var __reg1 = 0;
				while (__reg1 < __reg3.length) {
					__reg3[__reg1] == null ? null : (lineran = __reg3[__reg1]);
					++__reg1;
				}
				var __reg6 = App.linepos[lineran];
				App.linedir[lineran] <= 0 ? (xx = screenwid + 30) : (xx = -30);
				var __reg8 = 1;
				__reg1 = 0;
				while (__reg1 < App.rings.length) {
					if (Math.abs(__reg6 - App.rings[__reg1]._y) < 20) {
						if (Math.abs(xx - App.rings[__reg1]._x) < 100) {
							__reg8 = 0;
						}
					}
					++__reg1;
				}
				if (__reg8) {
					--dd;
					if (dd) {
						var __reg4 = 1 + random(4);
					} else {
						dd = bonusdelay;
						__reg4 = getrandom("bonustipe");
						__reg4 == 12 && App.slow ? (__reg4 = 1, 1) : null;
						__reg4 == 13 && App.big ? (__reg4 = 1, 1) : null;
						__reg4 == 16 && App.triplebonus ? (__reg4 = 1, 1) : null;
						__reg4 == 15 && App.waktu > 0.8 * App.waktumax ? (__reg4 = 1, 1) : null;
						__reg4 == 14 && App.balls.length > 5 ? (__reg4 = 1, 1) : null;
					}
					makering(__reg4, xx, __reg6);
				}
			}
			--td;
			if (!td) {
				switchline = getrandom("lineid");
				linefree = [null, 1, 2, 3];
				linefree[switchline] = null;
			}
			if (td < 0) {
				var __reg7 = 1;
				__reg1 = 0;
				while (__reg1 < App.rings.length) {
					App.rings[__reg1].line == switchline ? (__reg7 = 0, 0) : null;
					++__reg1;
				}
				if (__reg7) {
					linedir[switchline] = 0 - linedir[switchline];
					linespeed[switchline] = linespeednormal + 0.1 * random(linespeedrandom);
					linefree[switchline] = switchline;
					td = trafficdelay;
				}
			}
			App.big <= 0 ? null : (App.big--, App.big ? null : (App.dotspace = App.dotspacenormal));
			App.triplebonus <= 0 ? null : App.triplebonus--;
			if (App.slow > 0) {
				--App.slow;
				if (App.slow.isMultipleOf(13)) {
					__reg1 = 0;
					while (__reg1 < App.rings.length) {
						var __reg2 = App.rings[__reg1];
						!(__reg2.x > 30 && __reg2.x < App.screenwid - 30);
						++__reg1;
					}
				}
			}
			if ((App.balls.length > 1 && !App.hold) || (App.balls.length >= 1 && App.hold)) {
				--App.removeball;
				if (App.removeball < 0) {
					var __reg5 = 0;
					__reg1 = 0;
					while (__reg1 < App.balls.length) {
						if (App.balls[__reg1].still) {
							__reg5 = App.balls[__reg1];
							break;
						}
						++__reg1;
					}
					if (__reg5) {
						m.attachMovie("balldisappear", "balldisappear" + App.bd, App.bd, {_x: App.balls[0]._x, _y: App.balls[0]._y, bcolor: __reg5.bcolor});
						++App.bd;
						App.balls.removeValue(__reg5);
						__reg5.removeMovieClip();
						App.removeball = App.removeballdelay;
					}
				}
			}
			--diff;
			if (diff) {
				return;
			}
			diff = diffdelay;
			linespeednormal = Math.min(5, linespeednormal + 0.2);
			linespeedrandom = Math.min(50, linespeedrandom + 2);
		}
		;
		arrow.onMouseMove = function() {
			this.x = this._parent._xmouse;
			this.y = this._parent._ymouse;
			updateAfterEvent();
			if (this.x < 266.5) {
				this._xscale = -100;
				return;
			}
			this._xscale = 100;
		}
		;
		stop();
	
	}

}